#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void Print(int arr[], int sz)
{
	for (int i = 0; i < sz; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
}

int main()
{
	int arr[9] = { 0 };
	for (int i = 0; i < 9; i++)
	{
		scanf("%d", &arr[i]);
	}
	int sz = sizeof(arr) / sizeof(arr[0]);
	Print(arr, sz);
	int left = 0;
	int right = sz - 1;
	while (left < right)
	{
		while ((left < right) && arr[left] % 2 == 1)
		{
			left++;
		}
		while ((left < right) && arr[right] % 2 == 0)
		{
			right--;
		}
		if (left < right)
		{
			int tmp = arr[left];
			arr[left] = arr[right];
			arr[right] = tmp;
			left++;
			right--;
		}
	}
	Print(arr, sz);

	return 0;
}